package com.ryl.yomall.weball.controller;

import com.ryl.yomall.model.common.result.Result;
import com.ryl.yomall.order.client.OrderFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Map;

/**
 * @Date 12:26
 * @Author ryl
 */
@Controller
public class TradeController {
    @Autowired
    private OrderFeignClient orderFeignClient;
    @GetMapping("/trade.html")
    public String trade(Model model){
        Result<Map<String, Object>> trade = orderFeignClient.trade ( );
        model.mergeAttributes ( trade.getData () );
        return "order/trade";
    }

}
